﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="LeftMenShow.aspx.cs" Inherits="_Default" %>

<%@ Import Namespace="Model" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections.Generic" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Main" runat="Server">
    <!--开始-->
    <div class="layui-col-md12" style="height: 30px;">
        <ul style="line-height: 35px;">
            <li style="float: left; margin-left: 10px;"><a style="color: #BF7F5F;">综合排序</a></li>
            <li style="float: left; margin-left: 10px;"><a>出版时间</a></li>
            <li style="float: left; margin-left: 10px;"><a>最新上架</a></li>
            <li style="float: left; margin-left: 10px;"><a>价格</a></li>
        </ul>
    </div>
    <table class="layui-table" lay-skin="line" lay-size="lg">
        <colgroup>
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <tbody>
            <%
                int count = 1;
                int liscount;//判定循环那张表
                List<Books>[] list = new List<Books>[2]{
                    seachbooks,books
                };
                if (seachbooks.Count > 0)
                {
                    liscount = 0;
                }
                else
                    liscount = 1;
                foreach (var item in list[liscount])
                {
            %>
            <tr>
                <td>
                    <div style="background-image: url(Bimage/<%=count%>.jpg); background-size: contain; width: 102px; height: 140px; border: solid #FFFFFF 1px;"></div>
                </td>
                <td>
                    <ul>
                        <li style="color: #8C87D0;"><%=item.BookName %></li>
                        <li>作者：<%=item.Author %></li>
                    </ul>
                </td>
                <td style="color: #8C222C;">￥<%=item.Price %></td>
                <td><font>库存：<%=item.Num %></font>
                    <a style="float: right; color: #B5AA9A;" href="BookDetail.aspx?BookName=<%=item.BookName%>&BookID=<%=item.BookID%>&BookAuthor=<%=item.Author %>&BookPrice=<%=item.Price %>&BookImageId=<%=count%>">前去购买</a>
                </td>
            </tr>
            <%
                    count++;
                    if (count == 12)
                    {
                        count = 1;
                    }
                }%>
        </tbody>
    </table>
    <!--结束-->
</asp:Content>

